package com.zx.server.api.Impl;

import com.zx.server.api.ContactServer;
import com.zx.server.entity.ContactEntity;
import com.zx.server.service.ContactService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @auther: zhangxin
 * @Description:
 */
@RestController
public class ContactServerImpl implements ContactServer {


    @Autowired
    ContactService contactService;

    @Override
    @RequestMapping("/addContact")
    public int addContact(@RequestBody ContactEntity contactEntity) {
        int num = contactService.addContact(contactEntity);
        return num;
    }

    @Override
    @RequestMapping("/getContactList")
    public List<ContactEntity> getContactList(@RequestParam(value = "ids",required=false) List<Integer> ids) {
        return contactService.getContactList(ids);
    }

}
